//
//  YJDZFffment.h
//  XOWMSDK
//
//  Created by SKL on 2017/11/8.
//  Copyright © 2017年 SKL. All rights reserved.
//

#import <Foundation/Foundation.h>
@class XOWMProduct;

typedef NS_ENUM(NSInteger, XOWMPlatformStyle)
{
    XOWMPlatformStyleDefault = 1,
    XOWMPlatformStyleImage,
};

typedef NS_ENUM(NSInteger, XOWMPlatformColor)
{
    XOWMPlatformColorDefault = 1,
    XOWMPlatformColorRed,
    XOWMPlatformColorOrange,
    XOWMPlatformColorBlue,
    XOWMPlatformColorCustom,
};

typedef NS_ENUM(NSInteger, XOWMPlatformLayout)
{
    XOWMPlatformLayoutDefault = 1,
    XOWMPlatformLayoutStyle1,
    XOWMPlatformLayoutStyle2,
    XOWMPlatformLayoutStyle3,
    XOWMPlatformLayoutStyle4,
};
/**
 *@pragma 回调Block：
 *                1.XOWMPlatform在没有设置代理的时候，会通过block返回信息
 *                2.按照逻辑，只有登录注册会在不设置代理的情况下调用，所以，现阶段只返回登录注册相应信息
 */
typedef void(^callBack)(NSDictionary * dict);


/**
 *@pragma 回调delegate
 */
@protocol XOWMPlatformDelegate<NSObject>

/**
 *@pragma 登录注册回调交易回调(交易回调callback==nil)
 */
- (void)receiveCallBack:(NSDictionary *)callback;
@end


@interface XOWMPlatform : NSObject
typedef struct
{
    callBack callback;
}XOWMPlatformPara;
typedef struct
{
    XOWMPlatform *(*platform)(void);
    XOWMPlatformPara (*getPara)(void);
    /**
     *@pragma 初始化(在application:didFinishLaunchingWithOptions:中注册)
     *@pragma appid           =    商户编号
     *@pragma serviceHeader   =    服务请求地址
     #@pragma key             =    公钥
     */
    void (*setPara) (XOWMPlatformPara para);
    void (*destroy) (XOWMPlatformPara para);
    void (*registerPlatform) (NSString *appID, NSString *serviceHeader, NSString *key);
    void (*platformStyle) (XOWMPlatformStyle style);
    void (*platformLayout) (XOWMPlatformLayout layout);
    void (*platformColorType) (XOWMPlatformColor type, UIColor *color);
    /**
     *@ pragma 登陆
     */
    void (*prepareLogin) (void);
    /**
     *@ pragma 注册
     */
    void (*prepareRegister) (void);
    /**
     *@ pragma
     */
    void (*zunbeizhifu) (XOWMProductPara product);
    void (*cancelzhifu) (void);
}XOWMPlatformManager;
XOWMPlatformManager platformManager(void);
@property (nonatomic, weak) id<XOWMPlatformDelegate>delegate;
@end
//测试update
